<template>
  <div class="outerBox">
    <div class="container">
      <img class="backImg" src="@/assets/组 30.png" alt="" @click="goBack" />
      <div>{{ title }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'headerPage',
  props: {
    title: {
      type: String,
      default: '标题',
    },
    backStep: {
      type: String,
      default: '-1',
    },
  },
  components: {},
  data() {
    return {}
  },
  methods: {
    goBack() {
      if (+this.backStep == '-1') {
        this.$router.go(+this.backStep)
      } else {
        this.$router.push({ path: this.backStep })
      }
    },
  },
  mounted() {},
  watch: {},
  computed: {},
  filters: {},
}
</script>

<style scoped lang="scss">
.container {
  width: 100%;
  height: 45px;
  background: #006bff;
  border-radius: 0px 0px 0px 0px;
  line-height: 45px;
  color: #ffffff;
  display: flex;
  align-items: center;
  font-size: 18px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  .backImg {
    width: 18px;
    height: 18px;
    margin: 0 10px;
  }
}
.outerBox {
  padding-top: 45px; /* 与导航栏高度相同 */
}
</style>
